Many networking devices adhere to the IEEE802.3 standard as their layer 1 and 2 interface. The layer 2 entity is known as the MAC (Medium Access Controller) and the layer 1 entity is known as the PHY (PHYsical layer). IEEE802.3 defines an interface between the MAC and the PHY, known as the MII (Medium Independent Interface).
FIG. 1 depicts the layered model of Ethernet that includes a Media MAC layer and a PHY layer. The MAC layer is responsible for, among other things, controlling access to the media and the PHY layer is responsible for transmitting bits of information across the media. In Ethernet, the interface between the MAC and the PHY is specified by IEEE 802.3 and has evolved from the 10 pin MII for 10/100 Ethernet, to the 20 pin GMII (Gigabit Media Independent Interface) for GE (Gigabit Ethernet), to the 36 pin XGMII (10 Gigabit Media Independent Interface) for 10 GE.
Thus, in a typical implementation, the MII operates at a speed of 100 or 10 mbps (MegaBits Per Second). The MAC sends Ethernet frames to the PHY at this rate and the PHY then sends the frame out on the medium. Typical PHYs operate at the same rate as the MAC/MII.
Certain newer implementations couple the MAC/MII with a PHY that is incapable of operating at the full rate. One example is an Ethernet-over-DSL (Digital Subscriber Line) PHY that might transmit at 15 mbps. Since the MAC and MII operate at a fixed rate (either 10 or 100 mbps in this case), a method must be used to throttle the MAC so that it does not overload the PHY.
This throttling is also known as “MAC-PHY rate matching”. There are four existing methods for MAC-PHY rate matching.
The first two methods depend on signals generated to indicate carrier sensing and collision detection. As is known in the art, Ethernet utilizes a shared medium protocol know as CSMA/CD (Carrier Sense Multiple Access with Collision Detection). Each node connected to the medium may transmit a message as long as no other message is currently being transmitted on the medium. Thus, each node listens to the medium prior to transmitting, for example by monitoring the current flow in a wire, to see if a carrier (signal) is being transmitted by another node. If a carrier is detected the PHY asserts a carrier detect signal that causes the MAC to delay transmission of a frame.
Additionally, it is possible for collisions to occur because one node may start to transmit after another node has transmitted but before the carrier is detected due to the delay of the propagation of the carrier. A node monitors its own transmission to detect a collision, for example by detecting a higher current than due to its own transmission. If a collision is detected then the PHY asserts a collision detect signal that causes the MAC to abort the transmission of the frame (collision back off).
The first MAC-PHY rate matching technique uses “collision back off”. As described above, collision back off is a feature of Ethernet in which the PHY signals to the MAC if another device on the network begins to transmit at the same time as the PHY. (The two transmitters thus “collide”.) In this case, the PHY signals to the MAC that a collision has occurred and the MAC ceases transmission, waits a random interval and tries to transmit again.
When used for rate matching, the PHY signals a collision when its buffers are full and the MAC tries to transmit another frame. In this case, the MAC will back off and try again. If the buffers have room, the PHY will accept the frame. Otherwise it will again signal collision.
The second method for rate matching uses an Ethernet feature called “carrier sense deferral”. In an Ethernet network, as described above, the PHY asserts a carrier sense signal to inform the MAC when another device on the network is transmitting. This assertion of the carrier sense signal is called a “deferral”. To prevent collisions, MAC will not transmit while the PHY is asserting carrier sense.
The PHY can assert the carrier sense signal when its transmit buffers are full to prevent the MAC from transmitting any more frames. Thus, carrier sense deferral may be used for rate matching. This method is described in IEEE802.3ah “Ethernet in the First Mile” standard.
The third method for rate matching uses MAC “Pause frames”. A “Pause frame” is a special Ethernet frame that, when received, instructs a MAC to stop transmitting. After a certain period, the MAC then resumes transmission. Pause frames are usually sent from remote network devices to the MAC.
In the case of rate matching, the PHY inserts a Pause frame in the received data stream which in turn instructs the MAC to stop transmitting. The PHY sends the pause frame when its transmit buffer is filled to a defined level. The buffer needs to be large enough to accept any frames that the MAC may transmit while receiving and processing the Pause frame. Using Pause frames allows the MAC and PHY to transmit and receive data at the same time, an improvement over using the collision signal for rate matching.
The fourth method of rate matching is known as “traffic shaping”. Typically, a MAC with data to transmit will use an IPG (Inter-Packet Gap) of 0.96 microseconds (for 100 mbps operation) between each frame. If the MAC has knowledge in advance of a desired traffic rate (the “target rate”), a traffic shaper on the MAC can increase the length of the IPG accordingly, thus reducing the rate at which frames are sent to the PHY equal to the target traffic rate. The PHY still needs a buffer to store each frame because the frames traverse the MII at 100 mbps, but in this case the MAC can wait for the buffer to be nearly empty before sending the next frame. Traffic shaping is currently employed on many Ethernet switches as a way to manage congestion on network links.
As will be described more fully below, each of these techniques has drawbacks and a need exists for an improved technique for MAC-PHY rate matching.